home *** CD-ROM | disk | FTP | other *** search
- scenario = GetProperties()
- scenario.ScenarioType = 1
- scenario.Title = "sc_Train_05_00"
- scenario.Map = "Beotorum.dat"
- scenario.Description = "sc_Train_05_01"
- scenario.Picture = "Train 05.dds"
- scenario.iSortOrder = 3
-
- scenario.vShowMessageBoxes[STDDT_AUTOFINISH_COMBAT] = false
- scenario.vShowMessageBoxes[STDDT_COMBAT_PHASE] = false
- scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_CAPITAL] = false
- scenario.vShowMessageBoxes[STDDT_YOU_CLEARED_TERRITORY] = false
- scenario.vShowMessageBoxes[STDDT_ENEMY_CLEARED_TERRITORY] = false
- scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_COUNTRY] = false
- scenario.vShowMessageBoxes[STDDT_ENEMY_CAPTURED_COUNTRY] = false
-
- Player(PT_PLAYER, RACE_HUMANS)
- Player(PT_AI, RACE_ALIENS)
-
- SetInitialCamera(-0.998092, 0.000000, 0.061746, 0.000000, -0.048500, 0.618885, -0.783983, 0.000000,-0.038214, -0.785482, -0.617704, 0.000000,1086.430786, 352.132141, -1211.224731, 1.000000)
-
- function InitialMOB()
- StartMOB(1)
-
- MoveUnit(1, 16, 44)
- MoveUnit(2, 17, 43)
- MoveUnit(3, 16, 42)
- MoveUnit(4, 17, 41)
- MoveUnit(5, 17, 39)
-
-
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_05_02")
-
- FlyCamera(-0.970719, 0.000000, -0.240218, 0.000000, 0.201668, 0.543327, -0.814939, 0.000000,0.130517, -0.839521, -0.527418, 0.000000,1070.245972, 257.881256, -1502.766968, 1.000000)
-
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_05_03")
-
- --FlyCamera(-0.518083, -0.000000, -0.855330, 0.000000, 0.682087, 0.603379, -0.413147, 0.000000,0.516089, -0.797454, -0.312601, 0.000000,1075.297241, 115.674759, -1676.306030, 1.000000)
- FlyCamera(-0.895584, 0.000000, -0.444892, 0.000000, 0.288132, 0.761943, -0.580020, 0.000000,0.338982, -0.647645, -0.682384, 0.000000,1071.141846, 154.296844, -1627.222290, 1.000000)
-
- SelectUnit2(4102)
- ShowXBallon(2, ARTILLERY, MBS_LEFT, 421, 646, "sc_Train_05_04")
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_05_05")
- UnselectUnit2(4102)
-
- --FlyCamera(0.980354, 0.000000, 0.197247, 0.000000, -0.165900, 0.540919, 0.824551, 0.000000, -0.106695, -0.841075, 0.530292, 0.000000, 1163.487671, 380.826782, -1745.963623, 1.000000)
- FlyCamera(0.953696, 0.000000, -0.300771, 0.000000, 0.195547, 0.759803, 0.620049, 0.000000,0.228527, -0.650154, 0.724621, 0.000000,1079.368530, 154.410767, -1766.846802, 1.000000)
-
- SetupUnit(4098, PILLBOX, 16, 46)
- SetupUnit(4099, PILLBOX, 17, 45)
- SetupUnit(4100, PILLBOX, 18, 44)
- SetupUnit(4101, PILLBOX, 19, 45)
- ShowXBallon(4, PILLBOX, MBS_LEFT, 580, 325, "sc_Train_05_06")
- FlyCamera(0.980354, 0.000000, 0.197247, 0.000000, -0.165900, 0.540919, 0.824551, 0.000000, -0.106695, -0.841075, 0.530292, 0.000000, 1163.487671, 380.826782, -1745.963623, 1.000000)
- ShowBallon(5, -1, MBS_CENTER, 17, 39, "sc_Train_05_07")
-
- FinishMOB()
- end
-
- function OnUnitDead(unit)
- if(unit == 4099) then
- StartMOB(1)
- StoreCamera()
- FlyCamera(0.954358, 0.000000, 0.298664, 0.000000, -0.254001, 0.526045, 0.811640, 0.000000, -0.157111, -0.850457, 0.502035, 0.000000, 1268.746826, 297.795807, -1738.909058, 1.000000)
- ShowBallon(10, -1, MBS_LEFT, 17, 45, "sc_Train_05_08")
- RestoreCamera()
- FinishMOB()
- end
-
- if GetAliveUnitsAmount(COLOR_RED) == 0 then
- StartMOB(1)
- ShowXBallon(4, -1, MBS_CENTER, 599, 381, "sc_Train_05_09")
- ShowXBallon(4, -1, MBS_CENTER, 599, 381, "sc_Train_05_10")
- FinishMOB()
- end
- end
-
- old_prompt = ""
-
- function OnUpdate()
- if IsAlive(4098) and IsDead(4099) and IsAlive(4100) and IsAlive(4101) and IsAlive(4103) then
- local pos = GetPos(4103)
- if pos.x ~= 17 or pos.y ~= 45 then
- ShowPrompting("sc_Train_05_11")
- return
- end
- end
-
- local bRocketUnderFire = false
-
- for enemy = 1, 5 do
- if CanAttackThisTurn(enemy, 4102, true) then
- bRocketUnderFire = true
- end
- end
-
- if bRocketUnderFire then
- ShowPrompting("sc_Train_05_12")
- return
- end
-
- if not AllUnitsMovedAndFiredIfCould() then
- ShowPrompting("sc_Train_05_13")
- else
- ShowPrompting("sc_Train_finish_phase")
- end
- end
-
- function OnEndAITurn()
- local bRocketUnderFire = false
-
- for enemy = 1, 5 do
- if CanAttackThisTurn(enemy, 4102, true) then
- bRocketUnderFire = true
- end
- end
-
- if bRocketUnderFire then
- StartMOB(1)
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_05_14")
- FinishMOB(1)
- end
- end
-
- function OnHexClicked(x, y, clicked_unit, selected_unit, command)
- if GetTurnNumber( COLOR_GREEN ) == 0 then
- if clicked_unit == 4103 and command == CMD_SELECT then
- StartMOB(1)
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_05_15")
- FinishMOB(1)
- end
- elseif GetTurnNumber( COLOR_GREEN ) == 1 then
- if selected_unit == 4103 and command == CMD_MOVE then
- if x ~= 17 or y ~= 45 then
- IncorrectAction("sc_Train_01_05")
- end
- end
- end
- end
-
- function CheckForVictory()
- if GetAliveUnitsAmount(COLOR_RED) == 0 then return GAMERESULT_VICTORY end
- if GetAliveUnitsAmount(COLOR_GREEN) == 0 then return GAMERESULT_DEFEAT end
- return GAMERESULT_NONE
- end
-
- function aiDefence(country)
- aiMustNot()
- end
-
- function aiUnit( unit )
- if (unit == 4099) then
- aiAddValue(2)
- end
- end
-
- function InitialSetup()
- Country(16, ALLIANCE_FNU_ALLY)
- Money(16, MONEY_GUERRILLA, 0)
- Money(16, MONEY_TOTAL_REVENUE, 0)
- PlaceCapital(16, 19, 51)
-
- Country(17, ALLIANCE_FL_ALLY)
- Money(17, MONEY_GUERRILLA, 0)
- Money(17, MONEY_TOTAL_REVENUE, 0)
-
- SetupUnit(4102, ARTILLERY, 18, 48)
- SetupUnit(4103, TANK, 18, 46)
- SetMP(4103, 0)
-
- SetupUnit(1, TANKA, 16, 40)
- SetupUnit(2, TANKA, 17, 39)
- SetupUnit(3, TANKA, 16, 38)
- SetupUnit(4, TANKA, 17, 37)
- SetupUnit(5, TANKA, 17, 35)
- end
-